﻿using System;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Input;

namespace Meliose.Controls.Docking
{
    public partial class DockablePanel : PropertyNotifierControl
    {
        #region Template Element

        private const string LayoutRootName = "LayoutRoot";
        protected UIElement LayoutRoot;

        #endregion Template Element

        public DockablePanel()
        {
            DefaultStyleKey = typeof(DockablePanel);
        }

        public override void OnApplyTemplate()
        {
            base.OnApplyTemplate();

            LayoutRoot = GetTemplateChild(LayoutRootName) as UIElement;
            if (LayoutRoot != null)
            {
                LayoutRoot.MouseLeftButtonDown += new MouseButtonEventHandler(LayoutRoot_MouseLeftButtonDown);
            }
        }

        private void LayoutRoot_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
        {
            throw new NotImplementedException();
        }

        private void RaisePropertyChanged(string propertyName, object oldValue, object newValue)
        {
            OnPropertyChangedEx(new Meliose.Core.PropertyChangedExEventArgs(propertyName, oldValue, newValue));
        }
    }
}
